home *** CD-ROM | disk | FTP | other *** search
- COUNT(3I) Last changed: 1-6-98
-
-
- NNAAMMEE
- CCOOUUNNTT - Counts the number of true array elements
-
- SSYYNNOOPPSSIISS
- CCOOUUNNTT (([MMAASSKK==]_m_a_s_k [,,[DDIIMM==]_d_i_m]))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- SSTTAANNDDAARRDDSS
- Fortran 90
-
- DDEESSCCRRIIPPTTIIOONN
- The CCOOUUNNTT intrinsic function counts the number of true array elements
- of argument _m_a_s_k along dimension _d_i_m. It accepts the following
- arguments:
-
- _m_a_s_k Must be of type logical. It must not be a scalar.
-
- _d_i_m Must be a scalar. It is an integer with a value in the
- range 1 <= _d_i_m <= _n, where _n is the rank of _m_a_s_k. The
- corresponding actual argument must not be an optional dummy
- argument. This function does a check on _d_i_m when present.
-
- CCOOUUNNTT is a transformational function. The name of this intrinsic
- cannot be passed as an argument.
-
- RREETTUURRNN VVAALLUUEESS
- The result is type integer. It is a scalar result if _d_i_m is absent or
- if _m_a_s_k has rank 1. Otherwise, the result is an array of rank _n-1 and
- of
- shape (_d , _d , ..., _d , _d , ..., _d ),
- 1 2 _d_i_m-1 _d_i_m+1 _n
- where (_d , _d , ..., _d )
- 1 2 _n
- is the shape of _m_a_s_k.
-
- The result of CCOOUUNNTT((_m_a_s_k)) has a value equal to the number of TTRRUUEE
- elements of _m_a_s_k or has the value 0 if _m_a_s_k is a zero-sized array.
-
- If _m_a_s_k has rank 1, CCOOUUNNTT((_m_a_s_k,, _d_i_m)) has a value equal to that of
- CCOOUUNNTT((_m_a_s_k)). Otherwise, the value of
-
- element (_s , _s , ..., _s , _s , ..., _s )
- 1 2 _d_i_m-1 _d_i_m+1 _n
- of CCOOUUNNTT((_m_a_s_k,, _d_i_m)) is equal to
- CCOOUUNNTT((MMAASSKK (_s , _s , ..., _s , : , _s , ..., _s )).
- 1 2 _d_i_m-1 _d_i_m+1 _n
-
- EEXXAAMMPPLLEESS
- Example 1:
-
- * CCOOUUNNTT(( ((// ..TTRRUUEE..,, ..FFAALLSSEE..,, ..TTRRUUEE.. //)) )) is 2.
-
- * CCOOUUNNTT((_m_a_s_k)) returns zero when _m_a_s_k is a zero-sized array.
-
- Example 2: Assume that BB is the following array:
-
- | 1 3 5 |
-
- | 2 4 6 |
-
- CC is the following array:
-
- | 0 3 5 |
-
- | 7 4 8 |
-
- * CCOOUUNNTT(( BB ..NNEE.. CC)) is 33
-
- * CCOOUUNNTT(( BB ..NNEE.. CC,, DDIIMM==11)) is [[22,, 00,, 11]]
-
- * CCOOUUNNTT(( BB ..NNEE.. CC,, DDIIMM==22)) is [[11,, 22]]
-
- * CCOOUUNNTT(( CC ..EEQQ.. 11)) returns zero because there are no true elements in
- the mask.
-
- Example 3: Assume that array NN is as follows:
-
- | 0 1 2 3 |
-
- | 4 5 6 7 |
-
- | 8 9 0 1 |
-
- In an array section reference, you can expect the following results:
-
- * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)))) is 55
-
- * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)),,DDIIMM==11)) is [[22,, 11,, 22]]
-
- * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)),,DDIIMM==22)) is [[33,, 22]]
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
- printed version of this man page.
-
-